// 评价反馈模块相关的TypeScript类型定义

/**
 * 课程评价信息
 */
export interface CourseReview {
  id: number
  courseId: number
  bookingId?: number
  userId: number
  user: {
    id: number
    name: string
    avatar: string
  }
  rating: number // 1-5星
  content: string
  images: string[]
  tags: string[]
  isAnonymous: boolean
  isFeatured: boolean
  helpfulCount: number
  isHelpful: boolean
  status: 'PENDING' | 'APPROVED' | 'REJECTED' | 'HIDDEN'
  createdAt: string
  replies: ReviewReply[]
}

/**
 * 课程评价列表响应数据
 */
export interface CourseReviewListResponse {
  summary: {
    totalCount: number
    avgRating: number
    ratingDistribution: {
      '1': number
      '2': number
      '3': number
      '4': number
      '5': number
    }
  }
  list: CourseReview[]
  total: number
  page: number
  pageSize: number
}

/**
 * 创建课程评价请求参数
 */
export interface CreateCourseReviewRequest {
  courseId: number
  bookingId?: number
  rating: number
  content: string
  tags?: string[]
  isAnonymous?: boolean
}

/**
 * 教练评分信息
 */
export interface CoachRating {
  id: number
  coachId: number
  userId: number
  user: {
    id: number
    name: string
    avatar: string
  }
  bookingId?: number
  overallRating: number
  professionalism?: number
  patience?: number
  enthusiasm?: number
  communication?: number
  content: string
  isAnonymous: boolean
  createdAt: string
}

/**
 * 教练评分列表响应数据
 */
export interface CoachRatingListResponse {
  summary: {
    totalCount: number
    avgOverallRating: number
    avgProfessionalism?: number
    avgPatience?: number
    avgEnthusiasm?: number
    avgCommunication?: number
  }
  list: CoachRating[]
  total: number
}

/**
 * 创建教练评分请求参数
 */
export interface CreateCoachRatingRequest {
  coachId: number
  bookingId?: number
  overallRating: number
  professionalism?: number
  patience?: number
  enthusiasm?: number
  communication?: number
  content: string
  isAnonymous?: boolean
}

/**
 * 评价回复信息
 */
export interface ReviewReply {
  id: number
  reviewId: number
  userId: number
  userType: 'COACH' | 'ADMIN' | 'MEMBER'
  content: string
  isOfficial: boolean
  createdAt: string
}

/**
 * 创建评价回复请求参数
 */
export interface CreateReviewReplyRequest {
  content: string
}

/**
 * 意见反馈信息
 */
export interface Feedback {
  id: number
  userId: number
  user?: {
    id: number
    name: string
    avatar: string
  }
  type: 'BUG' | 'FEATURE' | 'COMPLAINT' | 'SUGGESTION' | 'OTHER'
  category?: string
  title: string
  content: string
  images: string[]
  contactPhone?: string
  contactEmail?: string
  priority: 'LOW' | 'NORMAL' | 'HIGH' | 'URGENT'
  status: 'PENDING' | 'PROCESSING' | 'RESOLVED' | 'CLOSED' | 'REJECTED'
  reply?: string
  resolvedAt?: string
  createdAt: string
}

/**
 * 意见反馈列表响应数据
 */
export interface FeedbackListResponse {
  list: Feedback[]
  total: number
  page: number
  pageSize: number
}

/**
 * 创建意见反馈请求参数
 */
export interface CreateFeedbackRequest {
  type: 'BUG' | 'FEATURE' | 'COMPLAINT' | 'SUGGESTION' | 'OTHER'
  category?: string
  title: string
  content: string
  contactPhone?: string
  contactEmail?: string
}

/**
 * 处理意见反馈请求参数
 */
export interface HandleFeedbackRequest {
  status: 'PROCESSING' | 'RESOLVED' | 'CLOSED' | 'REJECTED'
  reply: string
}

/**
 * 审核评价请求参数
 */
export interface AuditReviewRequest {
  status: 'APPROVED' | 'REJECTED' | 'HIDDEN'
  rejectReason?: string
}

/**
 * 设置精选评价请求参数
 */
export interface SetFeaturedReviewRequest {
  isFeatured: boolean
}

/**
 * 评价统计响应数据
 */
export interface ReviewStatisticsResponse {
  period: string
  totalReviews: number
  avgRating: number
  ratingDistribution: {
    '1': number
    '2': number
    '3': number
    '4': number
    '5': number
  }
  courseStats?: {
    courseId: number
    courseName: string
    totalReviews: number
    avgRating: number
  }[]
  coachStats?: {
    coachId: number
    coachName: string
    totalReviews: number
    avgRating: number
  }[]
  dailyTrend: {
    date: string
    count: number
    avgRating: number
  }[]
  featuredReviews: CourseReview[]
}

/**
 * 举报评价请求参数
 */
export interface ReportReviewRequest {
  reviewId: number
  reason: string
  description?: string
}

/**
 * 举报记录信息
 */
export interface ReviewReport {
  id: number
  reviewId: number
  userId: number
  user?: {
    id: number
    name: string
    avatar: string
  }
  reason: string
  description?: string
  status: 'PENDING' | 'RESOLVED' | 'REJECTED'
  handlerId?: number
  handledAt?: string
  createdAt: string
}
